cd169b2cd64d9876bbc7c7756064681ecc98684b,webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/AjaxConfigManagerAction.java,AjaxConfigManagerAction,mergeWithMetaType,#Dictionary#ObjectClassDefinition#JSONObject#,192
Before Change
{
JSONObject type = new JSONObject();
type.put( "labels", Arrays.asList( ad[i].getOptionLabels() ) );
type.put( "values", Arrays.asList( ad[i].getOptionValues() ) );
entry.put( "type", type );
}
else
After Change
}
}
json.key( "name" );
json.value( ad[i].getName() );
json.key( "type" );
if ( ad[i].getOptionLabels() != null && ad[i].getOptionLabels().length > 0 )
{
json.object();
json.key( "labels" );
json.value( Arrays.asList( ad[i].getOptionLabels() ) );
json.key( "values" );
json.value( Arrays.asList( ad[i].getOptionValues() ) );
json.endObject();
}
else
{
json.value( ad[i].getType() );
}
if ( ad[i].getCardinality() == 0 )
{
// scalar
if ( value instanceof Vector )
{
value = ( ( Vector ) value ).get( 0 );
}
else if ( value.getClass().isArray() )
{
value = Array.get( value, 0 );
}
json.key( "value" );
json.value( value );
}
else
{
if ( value instanceof Vector )
{
value = new JSONArray( ( Vector ) value );
}
else if ( value.getClass().isArray() )
{
value = new JSONArray( Arrays.asList( ( Object[] ) value ) );
}
else
{
JSONArray tmp = new JSONArray();
tmp.put( value );
value = tmp;
}
json.key( "values" );
json.value( value );
}
if ( ad[i].getDescription() != null )
{
json.key( "description" );
json.value( ad[i].getDescription() );
}
json.endObject();
propertyList.put( ad[i].getID() );
}
json.key( "propertylist" );
json.value( propertyList );
}
// nothing more to display